﻿using FarmerJoe.ClassSettings;
using FarmerJoe.Helpers;
using Styx;
using Styx.TreeSharp;

namespace FarmerJoe.Classes
{
    public static partial class Druid
    {
        public static Composite CombatBehavior_LowLevel
        {
            get
            {
                return new PrioritySelector(
                    
                    Spells.WaitForCast(),
                    Misc.EnsureTarget(),

                    // Healing
                    //new Common.NeedToUseLifeSpirit(new Common.UseLifeSpirit()),
                    Common.UseHealthManaRegenAgent(ClassParser.HealthPotion,0),
                    AllFormsHeal(),

                    Inventory.UseTrinket1(),
                    Inventory.UseTrinket2(),

                    // Prefer to use Cat at low level as soon as its available to us (FYI at level 6)
                    Spells.Cast("Cat Form", ret => Me.Shapeshift != ShapeshiftForm.Cat),

                    Movement.MoveToLOS(),
                    Movement.FaceTarget(),
                    Movement.ForceFacingTarget(),

                    // Combat
                    Spells.Cast("Wrath", ret => Me.Shapeshift != ShapeshiftForm.Cat),
                    Spells.Cast("Moonfire", ret => (CT.AuraTimeLeft("Moonfire") < 3) && Me.Shapeshift != ShapeshiftForm.Cat),

                    Spells.Cast("Ferocious Bite", ret => Me.ComboPoints >= 4 || (CT.HealthPercent < 30 && Me.ComboPoints >= 1)),
                    Spells.Cast("Rake", ret => !CT.HasMyAura("Rake")),
                    Spells.Cast("Mangle", ret => Me.CurrentEnergy >= 40),

                    new Decorator(Movement.MoveToMelee(true), ret=> Me.Shapeshift == ShapeshiftForm.Cat),
                    new Decorator(Movement.MoveToTarget(true, 35f), ret => Me.Shapeshift != ShapeshiftForm.Cat)

                    
                    );
            }
        }
    }
}
